﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SmsUI
{
    public partial class InputNum : DevExpress.XtraEditors.XtraForm
    {
        public string PhoneNum { get; set; }
        public InputNum(string labelText, string defaultText = "0")
        {
            InitializeComponent();
            this.labelControl1.Text = labelText;
            this.txbNum.Text = defaultText;
            this.AcceptButton = btnConfirm;
            this.Load += new EventHandler(InputNum_Load);
        }

        void InputNum_Load(object sender, EventArgs e)
        {

            txbNum.Focus();
        }

        private void btnConfirm_Click(object sender, EventArgs e)
        {
            this.PhoneNum = txbNum.Text;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
